package com.lifo.order.dao;

import com.lifo.order.bean.HfOrder;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * Created by Administrator on 2018/6/30.
 */
@Mapper
public interface HfOrderMapper {

    /**
     * 查询用户订单
     * @param userId  用户id

     * @return
     */
    List<HfOrder> searchUserOrder(@Param(value = "userId") int userId);


    @Select("select * from hf_shopping_cart where cart_id = #{cartId} ")
    HfOrder searchHfOrderByCartId(@Param(value = "cartId") int cartId);

    /**
     * 保存用户订单
     * @param hfOrder
     * @return
     */
    Integer saveUserOrder(HfOrder hfOrder);


    /**
     * 修改用户订单
     * @param hfOrder
     */
    void updateUserOrder(HfOrder hfOrder);

    /**
     * 查询用户订单数
     * @param userId
     * @return
     */
    Integer searchUserOrderCount(Integer userId);
}
